package com.ycc.springcloud.service.impl;

import com.ycc.springcloud.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
public class EmailServiceImpl implements EmailService {
    @Autowired
    JavaMailSenderImpl javaMailSender;

    @Override
    public void Send(String msg) {
        SimpleMailMessage message=new SimpleMailMessage();
        message.setSubject("收到商城用户的留言");
        message.setText(msg);
        message.setFrom("2959606653@qq.com");
        message.setTo("2959606653@qq.com");
        javaMailSender.send(message);
    }
}
